﻿using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Text;
using Seagull.Model.Stat;

namespace Seagull.DAL.Stat
{
    public class FrameStatFileWriter:IDisposable
    {
        private readonly BinaryWriter _binaryWriter;

        public FrameStatFileWriter(Stream stream )
        {
            _binaryWriter = new BinaryWriter(stream);
        }

        public void Write(Statistic statistic )
        {
            _binaryWriter.Write(statistic.Max);
            _binaryWriter.Write(statistic.Avg);
        }

        public void Dispose()
        {
            if (_binaryWriter!= null)
            {
                _binaryWriter.Dispose();
            }
        }
    }
}
